<template>
  <count-to :startVal="prevData" :endVal="data" :suffix="suffix" :decimals="decimals"/>
</template>
<script>
import VueCountTo from "../VueCountTo";

var MyCountTo = {
  name: 'MyCountTo',
  components: {
    VueCountTo
  },
  props: {
    data: {
      type: Number,
      default: null,
    },
    suffix: {
      type: String,
      default: ''
    },
    duration: {
      type: Number,
      default: 1000
    },
    decimals: {
      type: Number,
      default: 0
    }
  },
  data: function () {
    return {
      prevData: 0
    }
  },
  watch: {
    data: function (nextValue, prevValue) {
      this.prevData = prevValue
    }
  },
};
export default MyCountTo
</script>